package com.example.sport.ui.two;

import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModelProvider;

import android.content.Intent;
import android.media.MediaPlayer;
import android.os.Bundle;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageButton;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.example.sport.FeedbackActivity;
import com.example.sport.R;
import com.example.sport.TimeActivity2;
import com.example.sport.databinding.FragmentOneBinding;
import com.example.sport.databinding.FragmentTwoBinding;
import com.example.sport.ui.one.OneViewModel;

public class TwoFragment extends Fragment {


    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // Inflate the layout for this fragment
        View inflate = inflater.inflate(R.layout.fragment_two, container, false);


        ImageButton btn1 =inflate.findViewById(R.id.ll5_11);
        btn1.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                startActivity(new Intent(getActivity(), historyActivity.class));
            }
        });
        ImageButton btn2 =inflate.findViewById(R.id.ll5_12);
        btn2.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                startActivity(new Intent(getActivity(), TestActivity.class));
            }
        });
//        ImageButton btn3 =inflate.findViewById(R.id.ll5_13);
//        btn3.setOnClickListener(new View.OnClickListener() {
//            @Override
//            public void onClick(View view) {
//                startActivity(new Intent(getActivity(), historyActivity.class));
//            }
//        });
        ImageButton btn4 =inflate.findViewById(R.id.ll5_14);
        btn4.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                startActivity(new Intent(getActivity(), FeedbackActivity.class));
            }
        });
//        ImageButton btn5 =inflate.findViewById(R.id.ll5_15);
//        btn5.setOnClickListener(new View.OnClickListener() {
//            @Override
//            public void onClick(View view) {
//
//            }
//        });

        return inflate;


    }
//    LinearLayout layout =inflate.findViewById(R.id.ll5);
//
//        layout.setOnClickListener(new View.OnClickListener() {
//            @Override
//            public void onClick(View view) {
//                switch (view.getId()) {
//                    case R.id.ll5_11:
//                        startActivity(new Intent(getActivity(), historyActivity.class));
//                        break;
//
//                    case R.id.ll5_12:
//                        startActivity(new Intent(getActivity(), TestActivity.class));
//                        break;
//                }
//            }
//        });
}